package com.gskj.demo.excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.alibaba.excel.metadata.CellData;

import java.util.Map;

/**
 * @author :CodingFarmer_码农  Connor(康纳)_郭
 * @date : 09:37 20.5.16
 * @Company : http://www.gskj.com
 * @Version : 1.0
 * <p>
 * 创建 excel监听器 ，继承 AnalysisEventListener
 */

public class ExcelListener extends AnalysisEventListener<DataDemo> {

    // 一行一行的读取
    @Override
    public void invoke(DataDemo dataDemo, AnalysisContext analysisContext) {
        System.out.println("行信息 " + dataDemo);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头 " + headMap);
    }

    // 读取完成后调用的方法
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
    }
}
